import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import LayoutIndex from '@/layout/LayoutIndex.vue'


export const constantRoutes: Array<RouteRecordRaw> = [
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/login/login.vue'),
        meta: { 
            title: '登录',
            hidden: true,
            NoAuth: true
        }
    },
    {
        path: '/AuthorizedToLogIn',
        name: 'AuthorizedToLogIn',
        component: () => import('@/views/AuthorizedToLogIn.vue'),
        meta: { 
            title: '授权登录',
            hidden: true,
            NoAuth: true
        }
    },
    {
        path: '/',
        component: LayoutIndex,
        redirect: '/home',
        children: [
            {
                path: 'home',
                name: 'home',
                component: () => import("@/views/User.vue"),
                meta: { 
                    title: '用户详情',
                    icon: 'Avatar',
                    NoAuth: true
                }
            }
        ]
    },
    {
        path: '/chat',
        component: LayoutIndex,
        meta: { 
            title: '收益统计',
            icon: 'ChatLineRound'
        },
        children: [
            {
                path: 'chat',
                name: 'chat',
                component: () => import("@/views/Chat.vue"),
                meta: { 
                    title: '收益统计',
                    icon: 'chat-square',
                    NoAuth: true
                }
            }
        ]
    },
    {
        path: '/cat',
        component: LayoutIndex,
        meta: { 
            title: '免费用户限制',
            icon: 'HelpFilled'
        },
        children: [
            {
                path: 'cat',
                name: 'cat',
                component: () => import("@/views/Count.vue"),
                meta: { 
                    title: '免费用户限制',
                    icon: 'home-filled',
                    NoAuth: true
                }
            }
        ]
    },
    {
        path: '/play',
        component: LayoutIndex,
        meta: { 
            title: '资费修改',
            icon: 'Key'
        },
        children: [
            {
                path: 'play',
                name: 'play',
                component: () => import("@/views/Play.vue"),
                meta: { 
                    title: '资费修改',
                    icon: 'home-filled',
                    NoAuth: true
                }
            }
        ]
    },
    {
        path: '/notice',
        component: LayoutIndex,
        meta: {
            title: '公告发布',
            icon: 'Promotion'
        },
        children: [
            {
                path: 'notice',
                name: 'notice',
                component: () => import("@/views/Notice.vue"),
                meta: {
                    title: '公告发布',
                    icon: 'home-filled',
                    NoAuth: true
                }
            }
        ]
    }
]

export const asyncRoutes = [
]

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: constantRoutes
})


export default router